verbatim
environment that uses a
monospace typewriter font. This monospace ensures
that the indentation is not affected. However, the
resulting output fails to distinguish between the various
tokens used in the code, e.g., boldface for keywords
like define and lambda, sans-serif
for constants like #t and 42, and italics for variables such as x and y
in (lambda (x y) (cons x (cons y '()))).
enableslatex
quick.tex
:
% quick.tex \documentstyle[11pt,slatex]{article} \begin{document} In Scheme, the expression \scheme|(set! x 42)| returns an unspecified value, rather than \scheme'42'. However, one could get a \scheme{set!} of the latter style by: \begin{schemedisplay} (extend-syntax (setq) [(setq x a) (begin (set! x a) x)]) \end{schemedisplay} \end{document}
\scheme
and is flanked by a pair of
identical characters that are not alphabets or {
.
As a special convenient case, SLaTeX also allows the form
\scheme{...}
. The SLaTeX control sequences
(``environment'') for displayed code are the opening
\begin{schemedisplay}
and the closing
\end{schemedisplay}
. One of the
\documentstyle
s is slatex
. (You could also
have written
``\input slatex.sty
'' in your file, where the
file called slatex.sty
(supplied with SLaTeX)
contains these and other SLaTeX-specific control
sequences.)
slatex
(say, from the Un*x command line) on it:
slatex quick
(orslatex quick.tex
)
\scheme
and
\begin
/\end{schemedisplay}
, and then calls
LaTeX on the result. The final result is the
quick.dvi
file, which when viewed or printed, looks
like: